<template>
  <div class="grid">
    <div>
      <div class="web-editor">
        <div class="web-editor__wrap">
          <SwQuilRichText @getContent="getContent" />
        </div>
      </div>
    </div>
    <OpuView :detail="form.content" />
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import SwQuilRichText from '@/package/SwQuilRichText/SwQuilRichText.vue'
import { DeltaOperation } from 'quill'
import OpuView from '@/package/OpuView/index.vue'
const form = ref<{ content: string }>({
  content: '',
})
const getContent = (content: { ops: DeltaOperation[] }) => {
  form.value.content = JSON.stringify(content)
}
</script>

<style lang="scss">
.logo {
  height: 6em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
.web-editor {
  width: 100%;
  height: 100%;
  &__wrap {
    padding-top: 20px;
    margin: 0 auto;
    width: fit-content;
    min-height: 100%;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.article-content {
  padding: 0 80px;
  margin-bottom: 50px;
}
.ql-container {
  box-sizing: border-box;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  height: 100%;
  margin: 0;
  position: relative;
  background: #fff;
  color: #2f3238;
}
</style>
